package VWorldGameStudio;

import com.google.gson.Gson;

import java.util.Vector;

/**
 * 剧情属性类
 */
public class FCPlot extends Sprite{
	// 剧情ID
	private String id;
	// 触发条件
	private String touchoff;
	// 动作记录
	private Vector<String> active;

	/**
	 * 注册
	 * 
	 * @param id
	 * @param touchoff
	 * @param active
	 */
	public void registerPlot(String id, String touchoff, Vector<String> active) {
		this.id = id;
		this.active = active;
		this.touchoff = touchoff;

		System.out.println(toString());
	}

	public String getId() {
		return id;
	}

	public Vector<String> getActive() {
		return active;
	}

	public String getTouchoff() {
		return touchoff;
	}

	public String getActiveOfNum(int num) {
		if (num >= active.size())
			return "<isend";
		else
			return active.get(num);
	}

	public String toString(){
		StringBuilder sb = new StringBuilder();
		sb.append("==剧情ID："+id);
		sb.append(" 触发条件："+touchoff);
		for(String s: active){
			sb.append("指令："+s);
		}
		return sb.toString();
	}
}
